{extend name="public/base"/}
{block name="style"}
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
{/block}
{block name="body"}
<div class="main-box clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>{$meta_title}</h2>
		</div>
		<div class="pull-right">
			<a class="btn btn-primary" href="{:url('add')}">新 增</a>
			<button class="btn btn-danger ajax-post confirm" url="{:url('del')}" target-form="ids">删 除</button>
		</div>
	</header>
	<div class="main-box-body clearfix">
		<div class="table-responsive clearfix">
			<table class="table table-hover">
				<thead>
					<tr>
						<th width="30"><input class="checkbox check-all" type="checkbox"></th>
						<th width="60">ID</th>
						<th>名称</th>
						<th>排序</th>
						<th>时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{notempty name="list"}
					{volist name="list" id="item"}
					<tr>
						<td>
							<input class="ids" type="checkbox" name="ids[]" value="{$item['id']}" />
						</td>
						<td>{$item['id']}</td>
						<td>{$item['name']}</td>
						<td>
							<a data-id="{$item.id}" href="{:url('form/edit?id='.$item['id'])}">{$item['title']}</a>
						</td>
						<td>
							<span>{$item.create_time|time_format}</span>
						</td>
						<td>
							{if $item['status']}
							<span class="label label-primary">{$item['status_text']}</span>
							{else/}
							<span class="label label-danger">{$item['status_text']}</span>
							{/if}
						</td>
						<td>
							<a href="{:url('admin/form/attr?form_id='.$item['id'])}">字段</a>
							<a href="{:url('admin/form/status?id='.$item['id'].'&status='.abs(1-$item['status']))}" class="ajax-get">{$item['status']|show_status_op}</a>
							<a href="{:url('admin/form/edit?id='.$item['id'])}">编辑</a>
							<a href="{:url('admin/form/del?id='.$item['id'])}" class="confirm ajax-get">删除</a>
							<a href="{:url('admin/form/lists?form_id='.$item['id'])}">数据</a>
						</td>
					</tr>
					{/volist}
					{else/}
					<td colspan="7" class="text-center">aOh! 暂时还没有创建模型!</td>
					{/notempty}
				</tbody>
			</table>
			{$page}
		</div>
	</div>
</div>
{/block}